using System;
using System.Web;
using System.Web.Profile;

namespace AugustaDevelopersGuild.Helpers
{
    public class ProfileHelpers
    {
        public static ProfileBase GetUserProfile()
        {
            string id = HttpContext.Current.User.Identity.Name.ToString();

            ProfileBase profileBase;
            if (!String.IsNullOrEmpty(id))
            {
                profileBase = ProfileBase.Create(id);
            }
            else
            {
                profileBase = HttpContext.Current.Profile as ProfileBase;
            }
            return profileBase;
        }
    }
}
